package com.decorator.pattern.decorator;

import com.decorator.pattern.component.WallBeautify;

/**
 * @author cc
 * @classname WallBeautifyDecorator
 * @description 装饰器角色类，实现并持有一个Component对象实例  墙面装修装饰器角色
 * @date 2022/3/27 22:34
 */
public abstract class WallBeautifyDecorator implements WallBeautify {

    private WallBeautify wallBeautify;

    public WallBeautifyDecorator(WallBeautify wallBeautify) {
        this.wallBeautify = wallBeautify;
    }

    @Override
    public void operation() {
        wallBeautify.operation();
        //进行装饰
        decoration();
    }

    /**
     * 提供一个抽象的 decoration 方法供不同的装饰器的实现类去实现，装饰器实现类自定义实现方法
     */
    public abstract void decoration();

}
